var app = getApp()
Page({
  data: {
    userPhone: '',
    userMail: ''
  },
  onLoad: function () {
    var that = this
    wx.request({
      url: app.globalData.url + 'findUserInforAction',
      data: {
        userId: app.globalData.userInfoList.userId,
      },
      success(res) {
        app.globalData.userInfoList = res.data
      }
    })
    that.setData({
      userPhone: app.globalData.userInfoList.userPhone,
      userMail: app.globalData.userInfoList.userMail,
      userId: app.globalData.userInfoList.userId
    })
  },
  p1: function (e) {
    this.setData({
      userPhone: e.detail.value
    })
  },
  p2: function (e) {
    this.setData({
      userMail: e.detail.value
    })
  },
  submit: function (e) {






    wx.request({
      url: app.globalData.url + 'alterUserInforAction',
      data: {
        userId: app.globalData.userInfoList.userId,
        userPhone: this.data.userPhone,
        userMail: this.data.userMail
      },
      success(e) {
        wx.showToast({
          title: '修改成功',
          icon: 'none'
        })
        wx.reLaunch({
          url: '../mine/mine',
        })
      }
    })

  }
})